﻿/**
 * This is a part of MCServe, which is available under the Apache license 2.0.
 * With this code, you may do whatever you want as long as that is not in conflict with this license.
 * In addition, you should have a reference to the original project to include (http://mcserve.codeplex.com).
 * 
 * Author       : Lars Krämer ( Xe77a )
 * Website      : http://www.lkraemer.de
 * Project      : MCServe (http://mcserve.codeplex.com)
 * Copyright    : Copyright (c) 2013 lkraemer.de
 * License      : http://mcserve.codeplex.com/license
 * Description  : This part contains the functions of MCServe API
 */

using MCServeAPI;
using MCServeLib;
using System;
using System.Collections;
using System.Collections.Generic;

namespace MCServeAPI
{

    public class JsonObjectStandardResult
    {
        /**
         * Liefert den Standard Json-String für den Aktionscode und das Ergebnis, sowie eine Nachricht.
         */
        private static String _Action = "";
        private static Boolean _Result = false;
        private static String _Message = "";

        public JsonObjectStandardResult()
        {
            Action = null;
            Result = false;
            Message = "";
        }
        public JsonObjectStandardResult(String action, Boolean result)
        {
            Action = action;
            Result = result;
            Message = "";
        }
        public JsonObjectStandardResult(String action, Boolean result, String message)
        {
            Action = action;
            Result = result;
            Message = message;
        }

        public String Action
        {
            get
            {
                return _Action;
            }
            set
            {
                _Action = value;
            }
        }
        public Boolean Result
        {
            get
            {
                return _Result;
            }
            set
            {
                _Result = value;
            }
        }
        public String Message
        {
            get
            {
                return _Message;
            }
            set
            {
                _Message = value;
            }
        }
    }

    public class JsonObjectApiVersion
    {
        /**
         * Gibt die aktuelle Version der API, sowie die letzte kompatible API-Version zurück.
         */
        private String _Action = "";
        private Boolean _Result = false;
        private MCVersion _ApiVersion = null;
        private MCVersion _CompatibleVersion = null;

        public JsonObjectApiVersion()
        {
            Action = null;
            Result = false;
            ApiVersion = null;
            CompatibleVersion = null;
        }
        public JsonObjectApiVersion(String action, Boolean result)
        {
            Action = action;
            Result = result;
            ApiVersion = null;
            CompatibleVersion = null;
        }
        public JsonObjectApiVersion(String action, Boolean result, MCVersion apiversion)
        {
            Action = action;
            Result = result;
            ApiVersion = apiversion;
            CompatibleVersion = null;
        }
        public JsonObjectApiVersion(String action, Boolean result, MCVersion apiversion, MCVersion compatibleversion)
        {
            Action = action;
            Result = result;
            ApiVersion = apiversion;
            CompatibleVersion = compatibleversion;
        }

        public String Action
        {
            get
            {
                return _Action;
            }
            set
            {
                _Action = value;
            }
        }
        public Boolean Result
        {
            get
            {
                return _Result;
            }
            set
            {
                _Result = value;
            }
        }
        public MCVersion ApiVersion
        {
            get
            {
                return _ApiVersion;
            }
            set
            {
                _ApiVersion = value;
            }
        }
        public MCVersion CompatibleVersion
        {
            get
            {
                return _CompatibleVersion;
            }
            set
            {
                _CompatibleVersion = value;
            }
        }
    }

    public class JsonObjectUpdateResult
    {
        /**
         * Gibt, wenn vorhanden, die neue Version des Updates zurück
         */
        private String _Action = "";
        private Boolean _Result = false;
        private Boolean _IsUpdate = false;
        private MCVersion _UpdateVersion = null;

        public JsonObjectUpdateResult()
        {
            Action = null;
            Result = false;
            IsUpdate = false;
            UpdateVersion = null;
        }
        public JsonObjectUpdateResult(String action, Boolean result)
        {
            Action = action;
            Result = result;
            IsUpdate = false;
            UpdateVersion = null;
        }
        public JsonObjectUpdateResult(String action, Boolean result, Boolean isupdate)
        {
            Action = action;
            Result = result;
            IsUpdate = isupdate;
            UpdateVersion = null;
        }
        public JsonObjectUpdateResult(String action, Boolean result, Boolean isupdate, MCVersion version)
        {
            Action = action;
            Result = result;
            IsUpdate = isupdate;
            UpdateVersion = version;
        }

        public String Action
        {
            get
            {
                return _Action;
            }
            set
            {
                _Action = value;
            }
        }
        public Boolean Result
        {
            get
            {
                return _Result;
            }
            set
            {
                _Result = value;
            }
        }
        public Boolean IsUpdate
        {
            get
            {
                return _IsUpdate;
            }
            set
            {
                _IsUpdate = value;
            }
        }
        public MCVersion UpdateVersion
        {
            get
            {
                return _UpdateVersion;
            }
            set
            {
                _UpdateVersion = value;
            }
        }
    }

    public class JsonObjectVersionResult
    {
        /**
         * Liefert eine Version zurück
         */
        private String _Action = "";
        private Boolean _Result = false;
        private MCVersion _Version = null;

        public JsonObjectVersionResult()
        {
            Action = null;
            Result = false;
            Version = null;
        }

        public String Action
        {
            get
            {
                return _Action;
            }
            set
            {
                _Action = value;
            }
        }
        public Boolean Result
        {
            get
            {
                return _Result;
            }
            set
            {
                _Result = value;
            }
        }
        public MCVersion Version
        {
            get
            {
                return _Version;
            }
            set
            {
                _Version = value;
            }
        }
    }

    public class JsonObjectForumGroups
    {
        /**
         * Liefert eine Version zurück
         */
        private String _Action = "";
        private Boolean _Result = false;
        private List<MCForumGroup> _ForumGroups = new List<MCForumGroup>();

        public JsonObjectForumGroups()
        {
            Action = null;
            Result = false;
            ForumGroups = new List<MCForumGroup>();
        }

        public String Action
        {
            get
            {
                return _Action;
            }
            set
            {
                _Action = value;
            }
        }
        public Boolean Result
        {
            get
            {
                return _Result;
            }
            set
            {
                _Result = value;
            }
        }
        public List<MCForumGroup> ForumGroups
        {
            get
            {
                return _ForumGroups;
            }
            set
            {
                _ForumGroups = value;
            }
        }
    }

    public class JsonObjectAccountLoginResult
    {
        /**
         * Liefert eine Version zurück
         */
        private String _Action = "";
        private Boolean _Result = false;
        private Guid _Guid = new Guid();

        public JsonObjectAccountLoginResult()
        {
            Action = null;
            Result = false;
            Guid = Guid.NewGuid();
        }

        public String Action
        {
            get
            {
                return _Action;
            }
            set
            {
                _Action = value;
            }
        }
        public Boolean Result
        {
            get
            {
                return _Result;
            }
            set
            {
                _Result = value;
            }
        }
        public Guid Guid
        {
            get
            {
                return _Guid;
            }
            set
            {
                _Guid = value;
            }
        }
    }

    public class JsonObjectAccountDeviceLoginResult
    {
        /**
         * Liefert eine Version zurück
         */
        private String _Action = "";
        private Boolean _Result = false;
        private Guid _Guid = new Guid();
        private MCApiMessage _Message = new MCApiMessage();

        public JsonObjectAccountDeviceLoginResult()
        {
            Action = null;
            Result = false;
            Guid = Guid.NewGuid();
            Message = new MCApiMessage();
        }

        public String Action
        {
            get
            {
                return _Action;
            }
            set
            {
                _Action = value;
            }
        }
        public Boolean Result
        {
            get
            {
                return _Result;
            }
            set
            {
                _Result = value;
            }
        }
        public Guid Guid
        {
            get
            {
                return _Guid;
            }
            set
            {
                _Guid = value;
            }
        }
        public MCApiMessage Message
        {
            get
            {
                return _Message;
            }
            set
            {
                _Message = value;
            }
        }
    }
}